import sys;
import os;
import os.path;

from fnmatch import fnmatch;

if __name__ == '__main__':
    if len(sys.argv) < 2:
        print "Usage: listpng.py <directory>";
        sys.exit(1);
        
    sDirectory = os.path.dirname(sys.argv[1]);
    for (curdir, dirs, files) in os.walk(sDirectory):
        for filename in files:
            if fnmatch(filename, "*.png"):
                sFileToList = os.path.join(curdir, filename);
                # remove leading path
                sLocalPath = sFileToList[len(sDirectory):];
                print sLocalPath;                
